package com.fss.model;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;


public class IndividualModel extends Model <IndividualModel>{
	private static final long serialVersionUID = 1L;
	public static final IndividualModel DAO=new IndividualModel(); 
	public Record getInfo(int uid){
		Record user =null;
	    user = Db.findFirst(
		"select * from px_staff ss join department dd ON dd.department_id =ss.department_id  join company cc ON cc.company_id =dd.company_id where px_staff_id=?",uid);
	    /*IndividualModel tt=new IndividualModel();
	    tt.set("staff_sex", "staff_sex");
	    tt.update();*/
	return user;
	}
	public boolean  updateStaf(String sta_id, String sex, String sta_bir,
			String sta_add, String sta_eml, String sta_tel) {
		System.out.println("编号："+sta_id);
		IndividualModel tt=new IndividualModel();
	    tt.set("staff_sex", "00");
	    tt.update();
		Db.update("update px_staff set staff_sex=?,staff_birthday=?,staff_address=?,staff_eml=?,staff_tel=? where px_staff_id=?", sex,sta_bir,sta_add,sta_eml,sta_tel,sta_id);
		return true;
		
	}
	
}
